# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=gperf
pkgver=3.0.4
pkgrel=3
pkgdesc="Perfect hash function generator"
arch=('x86_64' 'i686')
url="http://www.gnu.org/software/gperf/"
license=('GPL3')
groups=('base-devel')
depends=('gcc-libs' 'info')
makedepends=('gcc' 'texinfo')
install=gperf.install
source=("http://ftp.gnu.org/pub/gnu/gperf/${pkgname}-${pkgver}.tar.gz"{,.sig}
        gperf-3.0.4-tests-cygwin-setmode.patch)
sha1sums=('e32d4aff8f0c730c9a56554377b2c6d82d0951b8'
          'SKIP'
          'fd84ee0da23320e7b2bda76a340e5b00dad7f042')
options=('!makeflags')

prepare() {
  cd "${srcdir}"/${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/gperf-3.0.4-tests-cygwin-setmode.patch
}

build() {
  cd "${srcdir}"/${pkgname}-${pkgver}
  ./configure \
    --build=${CHOST} \
    --prefix=/usr \
    --docdir=/usr/share/gperf/doc/
  make
}

check() {
  cd "${srcdir}"/${pkgname}-${pkgver}
  make check
}

package() {
  cd "${srcdir}"/${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}
